package com.ruoyi.web.core.config.influx;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "spring.influx")
@Data
public class InfluxDBProperties {

    private String url;

    private String token;

    private String org;

    private String bucket;

//    @Bean
//    public InfluxDBClient influxDBClient() {
//        InfluxDBClient influxDBClient = InfluxDBClientFactory.create(url, token.toCharArray(), org, bucket);
//        influxDBClient.setLogLevel(LogLevel.BASIC);
//        return influxDBClient;
//    }
//
//    public static void main(String[] args) {
//
//        String token = "rocBkQoCh4e8bW2bG5wDNVf4po6qJEB8SRxg-eXLxGmi2p2Y-nYItu8J_7IBo7vlblwvYl4-Pv4ye5r1HMShYA==";
//        String bucket = "beyond";
//        String org = "beyond";
//        InfluxDBClient client = InfluxDBClientFactory.create("http://139.155.248.8:28086", token.toCharArray());
//    }
}